home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic 4 Database How-To / Visual Basic 4 Database - How-to (The Waite Group)(1995).iso / reccount.fr_ / reccount.fr
Text File  |  1995-07-04  |  5KB  |  146 lines

  1. VERSION 4.00
  2. Begin VB.Form Form1 
  3.    BackColor       =   &H00C0C0C0&
  4.    Caption         =   "Record Counts"
  5.    ClientHeight    =   3420
  6.    ClientLeft      =   870
  7.    ClientTop       =   1455
  8.    ClientWidth     =   6570
  9.    BeginProperty Font 
  10.       name            =   "MS Sans Serif"
  11.       charset         =   0
  12.       weight          =   700
  13.       size            =   8.25
  14.       underline       =   0   'False
  15.       italic          =   0   'False
  16.       strikethrough   =   0   'False
  17.    EndProperty
  18.    Height          =   3825
  19.    Left            =   810
  20.    LinkTopic       =   "Form1"
  21.    MaxButton       =   0   'False
  22.    ScaleHeight     =   3420
  23.    ScaleWidth      =   6570
  24.    Top             =   1110
  25.    Width           =   6690
  26.    Begin VB.CommandButton cmdExit 
  27.       Cancel          =   -1  'True
  28.       Caption         =   "Exit"
  29.       Default         =   -1  'True
  30.       Height          =   615
  31.       Left            =   2640
  32.       TabIndex        =   3
  33.       Top             =   2580
  34.       Width           =   1455
  35.    End
  36.    Begin VB.Label lblDynasetMoved 
  37.       Alignment       =   2  'Center
  38.       BorderStyle     =   1  'Fixed Single
  39.       BeginProperty Font 
  40.          name            =   "MS Sans Serif"
  41.          charset         =   0
  42.          weight          =   700
  43.          size            =   9.75
  44.          underline       =   0   'False
  45.          italic          =   0   'False
  46.          strikethrough   =   0   'False
  47.       EndProperty
  48.       Height          =   315
  49.       Left            =   4980
  50.       TabIndex        =   6
  51.       Top             =   1800
  52.       Width           =   1155
  53.    End
  54.    Begin VB.Label lblDynasetCreate 
  55.       Alignment       =   2  'Center
  56.       BorderStyle     =   1  'Fixed Single
  57.       BeginProperty Font 
  58.          name            =   "MS Sans Serif"
  59.          charset         =   0
  60.          weight          =   700
  61.          size            =   9.75
  62.          underline       =   0   'False
  63.          italic          =   0   'False
  64.          strikethrough   =   0   'False
  65.       EndProperty
  66.       Height          =   315
  67.       Left            =   4980
  68.       TabIndex        =   5
  69.       Top             =   1020
  70.       Width           =   1155
  71.    End
  72.    Begin VB.Label lblTable 
  73.       Alignment       =   2  'Center
  74.       BorderStyle     =   1  'Fixed Single
  75.       BeginProperty Font 
  76.          name            =   "MS Sans Serif"
  77.          charset         =   0
  78.          weight          =   700
  79.          size            =   9.75
  80.          underline       =   0   'False
  81.          italic          =   0   'False
  82.          strikethrough   =   0   'False
  83.       EndProperty
  84.       Height          =   315
  85.       Left            =   4980
  86.       TabIndex        =   4
  87.       Top             =   300
  88.       Width           =   1155
  89.    End
  90.    Begin VB.Label Label3 
  91.       BackColor       =   &H00C0C0C0&
  92.       Caption         =   "Records in the BIBLIO.MDB SELECT * FROM Authors dynaset after using the MoveLast method."
  93.       Height          =   675
  94.       Left            =   480
  95.       TabIndex        =   2
  96.       Top             =   1680
  97.       Width           =   4215
  98.    End
  99.    Begin VB.Label Label2 
  100.       BackColor       =   &H00C0C0C0&
  101.       Caption         =   "Records in the BIBLIO.MDB SELECT * FROM Authors dynaset immediately after creation."
  102.       Height          =   435
  103.       Left            =   480
  104.       TabIndex        =   1
  105.       Top             =   960
  106.       Width           =   4095
  107.    End
  108.    Begin VB.Label Label1 
  109.       BackColor       =   &H00C0C0C0&
  110.       Caption         =   "Records reported in the BIBLIO.MDB Authors table recordset:"
  111.       Height          =   435
  112.       Left            =   480
  113.       TabIndex        =   0
  114.       Top             =   240
  115.       Width           =   4155
  116.    End
  117. End
  118. Attribute VB_Name = "Form1"
  119. Attribute VB_Creatable = False
  120. Attribute VB_Exposed = False
  121. Option Explicit
  122.  
  123. Private Sub Form_Load()
  124.     Dim db As DATABASE
  125.     Dim tbl As Recordset
  126.     Dim dyn As Recordset
  127.     Dim dbName As String
  128.  
  129.   ' Get the database name and open the database.
  130.     dbName = BiblioPath()       ' BiblioPath is a function in READINI.BAS
  131.     
  132.     Set db = DBEngine.Workspaces(0).OpenDatabase(dbName)
  133.     Set tbl = db.OpenRecordset("Authors", dbOpenTable)
  134.     lblTable = tbl.RecordCount
  135.     Set dyn = db.OpenRecordset("SELECT * FROM Authors", dbOpenDynaset)
  136.     lblDynasetCreate = dyn.RecordCount
  137.     dyn.MoveLast
  138.     dyn.MoveFirst
  139.     lblDynasetMoved = dyn.RecordCount
  140. End Sub
  141.  
  142. Private Sub cmdExit_Click()
  143.     End
  144. End Sub
  145.  
  146.